<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link href="css/main.css?v=d4c89955dc8ad6705982" rel="stylesheet">
		<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
		<link href="css/register.css" rel="stylesheet" />
		<link rel="stylesheet" href="css/swiper.min.css" />
		<link rel="stylesheet" href="css/video-js.min.css" />
		<link rel="stylesheet" href="css/newbase.css" />
		<link rel="stylesheet" href="css/newstyle.css" />
		<link rel="stylesheet" href="css/neworder.css" />
		<link rel="stylesheet" href="css/iconfont.css" />
	</head>
	<body>
		<div class="navigation animated">
			<script type="text/javascript" src="https://api.map.baidu.com/api?ak=dZjnRr2t8nBpGswyCB731AFD&v=2.0&s=1"></script>
			<div id="allmap" style="display:none;"></div>
			<div class="nav-wrap">
				<h1 class="logo">
            		<a href="javascript:;"><img src="images/UU-logo.png" alt="uu-logo" height="75px"></a>
        		</h1>
				<div class="nav">
					<ul class="nav-list clearfix">
						<li>
							<a href="index.html" title="首页">首页</a>
						</li>
						<li>
							<a href="myOrder.html" title="我的订单">订单大厅</a>
						</li>
						<li>
							<a href="buy.html" title="在线下单">在线下单</a>
						</li>
						<li>
							<a href="myOrder.html" title="我的订单">我的订单</a>
						</li>

					</ul>
					<div style="clear:both;"></div>
				</div>
				<div class="button-group">

					<ul class="button-list welcome" id="userinfo">
						<li>
							<a href="login.html" class="port fl"><img src="images/port.png" width="22" height="22"style="margin-bottom: 20px;margin-right: 10px;" />登录</a>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<div class="index">
			<div class="login" style="min-width: 1266px;">
				<div class="contentBox" style="background-image: url(images/contentBack.png);background-size: 100% 100%;width:100%;height: 100%;position:absolute; ">
					<div class="content">
						<div>
							<div class="register">
								<div class="title text-shadow">注册用户账号</div>
								<div class="common" id="rigister_one" style="display: block;">
									<div class="datum_ipt"><input id="phone" type="tel" placeholder="使用你的手机号为注册账号">
									</div>
									<div class="datum_ipt"><input id="password" type="password" placeholder="请设置您的密码">
									</div>
									<div class="datum_ipt"><input id="repassword" type="password" placeholder="重复您设置的密码">
									</div>
									<div class="datum_ipt"><input id="name" type="text"  placeholder="填写你的昵称" style="padding-right: 96px;">
									</div>
									<div class="datum_ipt"><input id="email" type="email" placeholder="填写你的邮箱地址" >
									</div>
									<div class="datum_ipt">
										<select  id="gender" style="border-radius: 4px;">
											<option value="男" selected="selected" >男</option>
											<option value="女">女</option>
										</select>
									</div>
									<button  element-loading-text="正在提交数据请稍后" class="next_step" id="rigister">注册</button>
								</div>
								</div>
								<!---->
								<!---->
							</div>
							<!---->
						</div>
					</div>
				</div>
			</div></div>
		<script type="text/javascript">
			$(function() {

			    $("#rigister").click(function () {

					var phone = $("#phone").val();
					if (phone == ""){alert("请填写你的手机号码！");return;}
                    var reg = /^1[34578][0-9]{9}$/; //验证规则
                    if (!reg.test(phone)){
                        alert("手机号码格式不正确");return;
                    }
                    var password = $("#password").val();
                    if (password.length<6 || password.length>16){
                        alert("密码的长度为6—16个字符或数字");
                        return ;
					}
					var repassword = $("#repassword").val();
                    if (password != password){
                        alert("两次输入的密码不相同");
                        return;
					}
					var name = $("#name").val();
                    if (name == ""){
                        alert("请填写你的昵称");
                        return;
					}
					var email = $("#email").val();
                    var reg2 = /\w+[@]{1}\w+[.]\w+/;
                    if (!reg2.test(email)){
                        alert("你的邮箱格式不合法");
                        return;
					}
					var gender = $("#gender").val();
					$.ajax({
						url:"/register",
						dataType:"json",
						type:"post",
						data:{
                            "account":phone,
							"phone":phone,
							"password":password,
							"name":name,
							"email":email,
							"gender":gender
						},
						success:function (data) {
							alert(data.msg);
							if (data.success){
							    window.location.href="login.html"
							}
                        }
					})
                })
            })
		</script>
	</body>

</html>